<template>
    <button @click="init">点击</button>
    <div data-title="Welcome!" data-intro="Hello World!">
        hello!
    </div>
    <div data-title="Welcome1111!" data-intro="Hello World!222">
        hello!
    </div>
</template>

<script setup lang="ts">
import introJs from 'intro.js';
import { nextTick, onBeforeMount, onMounted } from 'vue';

const intro = introJs();
function init() {
    intro.setOptions({
        steps: [
            {
                element: document.querySelector('[data-title="Welcome!"]'),
                intro: "这是第一个步骤",
            },
            {
                element: document.querySelector('[data-title="Welcome1111!"]'),
                intro: "这是第二个步骤",
            },
        ]
    })
    intro.start()
}

</script>

<style lang="scss" scoped></style>